﻿<UserControl x:Class="MementoClient.WorkLogEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" Height="300" Width="343">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="boolToVis" />
    </UserControl.Resources>
    <Canvas Width="342">
        <Label Content="Minutes: " Canvas.Left="0" Canvas.Top="32" />
        <TextBox Canvas.Left="65" Canvas.Top="36" Width="59" Text="{Binding Minutes}" Height="22" />
        <Label Content="Workdate: " Canvas.Left="0" Canvas.Top="64" />
        <TextBox Canvas.Left="65" Canvas.Top="64" Width="98" Text="{Binding Workdate}" Height="26" />
        <Label Content="{Binding Task.Name}" Canvas.Left="6" Canvas.Top="6" Height="24" Width="323" />
        <Label Content="Categories: " Canvas.Left="0" Canvas.Top="99" />
        <ListBox ItemsSource="{Binding Categories}" Canvas.Left="70" Canvas.Top="99" Width="259" Height="72">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Label Content="{Binding Name}" />
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <Label Visibility="{Binding AreCategoryGroupsNotAvailable, Converter={StaticResource boolToVis}}" Canvas.Left="14" Canvas.Top="177" Height="30" Name="noCategoriesAvailable" Content="There are no categories available for this WorkLog." Width="315" />
        <Canvas Visibility="{Binding AreCategoryGroupsAvailable, Converter={StaticResource boolToVis}}">
            <ComboBox ItemsSource="{Binding AvailableCategoryGroups}" SelectedItem="{Binding SelectedCategoryGroup}" Canvas.Left="14" Canvas.Top="177" Height="25" Name="comboBox1" Width="315" />
            <ComboBox ItemsSource="{Binding SelectedCategoryGroup.Categories}" SelectedItem="{Binding SelectedCategory}"  Canvas.Left="14" Canvas.Top="208" Height="22" Name="comboBox2" Width="315" />
            <Button Content="Add This Category" Command="{Binding AddThisCategory}" Canvas.Left="173" Canvas.Top="236" Width="156" />
        </Canvas>
        <Button Content="Save" Command="{Binding Submit}" Canvas.Left="247" Canvas.Top="264" Width="82" Height="24" />
    </Canvas>
</UserControl>
